# Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers.  See the top-level LICENSE file for dates and other
# details.  No copyright assignment is required to contribute to VisIt.

#****************************************************************************
# Modifications:
#
#   Hank Childs, Sat Jun  5 19:03:22 CDT 2010
#   Add avtPICSFilter.
#
#   Hank Childs, Sun Jun  6 14:54:08 CDT 2010
#   Renamed avt*SLAlgorithm to avt*ICAlgorithm.
#
#   Eric Brugger, Wed Jun 30 12:59:41 PDT 2010
#   I added avtXRayFilter.
#
#   Hank Childs, Thu Aug 26 13:47:30 PDT 2010
#   Renamed avtCurrentExtentFilter to avtActualExtentsFilter.
#
#   Brad Whitlock, Fri Dec 10 16:21:23 PST 2010
#   I moved avtThresholdFilter to here from the Threshold plugin.
#
#   Eric Brugger, Tue Oct 25 13:55:27 PDT 2011
#   Add avtMultiresFilter.
#
#   Hank Childs, Tue Mar 13 12:59:07 PDT 2012
#   Move avtDatasetOnDemandFilter from Pipeline/AbstractFilters directory.
#
#   Kathleen Biagas, Tue May 28 17:02:23 MST 2013 
#   Move avtTimeLoopFilter and avtTimeLoopCollectorFilter from 
#   Pipeline/AbstractFilters directory.
#
#   Kevin Griffin, Mon Nov 3 12:41:11 PDT 2014
#   Add avtSubsetBlockMergeFilter.
#
#   Eric Brugger, Thu Jan 14 08:44:32 PST 2016
#   Add linking of vtkm library.
#
#   Cyrus Harrison, Mon Nov  7 10:03:35 PST 2016
#   Add avtPolylineCleanupFilter
#
#   Eric Brugger, Tue Aug 28 14:35:30 PDT 2018
#   I replaced support for vtkm with vtkh.
#
#   Kathleen Biagas, Fri Jul 19 12:13:02 PDT 2019
#   Added vtkCommonMath, vtkCommonTransforms, vtkFiltersGeneral in support
#   of building plugins vs install on Windows. They are direct depencencies
#   for this library, and CMake automagically pulls them in when compiling
#   VisIt even if not listed, but not when building the plugins.
#
#   Kathleen Biagas, Tue Nov  5 08:12:29 PST 2019
#   Remove avtPolylineToRibbonFilter, avtPolylineToTubeFilter,
#   avtPolylineAddEndPointsFilter, avtPointToGlyphFilter.
#
#   Kathleen Biagas, Thu Jun  4 16:30:37 PDT 2020
#   Add avtVertexExtractor, avtLineGlyphFilter.C
#
#   Eric Brugger, Fri Feb 24 14:57:15 PST 2023
#   I replaced vtkh with vtkm.
#
#   Kathleen Biagas, Wed Mar 15, 2023 
#   Only link with pthread if not on Windows.
#
#   Eric Brugger, Tue Jul 25 11:23:55 EDT 2023
#   Change pthread to Threads::Threads.
#
#****************************************************************************/

SET(AVTFILTERS_SOURCES
avtActualExtentsFilter.C
avtCondenseDatasetFilter.C
avtContourFilter.C
avtCoordSystemConvert.C
avtCurveConstructorFilter.C
avtCustomTransform.C
avtDatasetOnDemandFilter.C
avtDisplaceFilter.C
avtFacelistFilter.C
avtFeatureEdgesFilter.C
avtGhostZoneAndFacelistFilter.C
avtGhostZoneFilter.C
avtImageCommunicator.C
avtImageCompositer.C
avtLinearTransformFilter.C
avtLineGlyphFilter.C
avtLineoutFilter.C
avtLineScanFilter.C
avtLineToPolylineFilter.C
avtMassVoxelExtractor.C
avtMeshLogFilter.C
avtMissingDataFilter.C
avtMultiresFilter.C
avtNamedSelectionFilter.C
avtPolylineCleanupFilter.C
avtRayCompositer.C
avtRayTracerBase.C
avtRayTracer.C
avtResampleFilter.C
avtSamplePointCommunicator.C
avtSamplePointExtractorBase.C
avtSamplePointExtractor.C
avtSamplePointToSurfaceFilter.C
avtShiftCenteringFilter.C
avtSimilarityTransformFilter.C
avtSmoothPolyDataFilter.C
avtStaggeringFilter.C
avtSubsetBlockMergeFilter.C
avtSummationFilter.C
avtSurfaceFilter.C
avtThresholdFilter.C
avtTiledImageCompositor.C
avtTimeLoopCollectorFilter.C
avtTimeLoopFilter.C
avtTransform.C
avtValueImageCompositer.C
avtVertexExtractor.C
avtVertexNormalsFilter.C
avtVoxelExtractor.C
avtWarpFilter.C
avtWholeImageCompositerNoZ.C
avtWholeImageCompositerWithZ.C
avtWorldSpaceToImageSpaceTransform.C
avtXRayFilter.C
)

IF(VISIT_SLIVR)
    LIST(APPEND AVTFILTERS_SOURCES
         avtSLIVRCommon.C
         avtSLIVRImageCompositor.C
         avtSLIVRRayTracer.C
         avtSLIVRSamplePointExtractor.C
         avtSLIVRVoxelExtractor.C)
    ADD_DEFINITIONS(-DVISIT_SLIVR)
ENDIF()

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${VISIT_COMMON_INCLUDES}
${VISIT_SOURCE_DIR}/visit_vtk/full
${VISIT_SOURCE_DIR}/visit_vtk/lightweight
${VISIT_SOURCE_DIR}/avt/DBAtts/MetaData
${VISIT_SOURCE_DIR}/avt/DBAtts/SIL
${VISIT_SOURCE_DIR}/avt/Database/Database
${VISIT_SOURCE_DIR}/avt/Database/Ghost
${VISIT_SOURCE_DIR}/avt/IVP
${VISIT_SOURCE_DIR}/avt/Math
${VISIT_SOURCE_DIR}/avt/Pipeline/AbstractFilters
${VISIT_SOURCE_DIR}/avt/Pipeline/Data
${VISIT_SOURCE_DIR}/avt/Pipeline/Pipeline
${VISIT_SOURCE_DIR}/avt/Pipeline/Sinks
${VISIT_SOURCE_DIR}/avt/Pipeline/Sources
${VISIT_SOURCE_DIR}/avt/Plotter
${VISIT_SOURCE_DIR}/avt/View
${VISIT_SOURCE_DIR}/avt/VisWindow/Proxies
${VISIT_SOURCE_DIR}/avt/VisWindow/Tools
${VISIT_SOURCE_DIR}/avt/VisWindow/VisWindow
${VISIT_SOURCE_DIR}/engine/main
${VTKm_INCLUDE_DIRS}
${VTK_INCLUDE_DIRS}
)

set(vtklibs VTK::CommonMath VTK::CommonTransforms VTK::FiltersGeneral VTK::FiltersModeling)

# Add link directories
LINK_DIRECTORIES(${LIBRARY_OUTPUT_DIRECTORY})

#********************************* SERIAL ************************************
ADD_LIBRARY(avtfilters_ser ${AVTFILTERS_SOURCES})
TARGET_LINK_LIBRARIES(avtfilters_ser visitcommon lightweight_visit_vtk visit_vtk avtmath avtview avtpipeline_ser avtdatabase_ser avtdbatts ${vtklibs})
if(HAVE_LIBVTKM)
    target_link_libraries(avtfilters_ser vtkm_cont vtkm_filter_contour vtkm_filter_entity_extraction vtkm_filter_field_conversion)
    if(NOT WIN32)
        target_link_libraries(avtfilters_ser Threads::Threads)
    endif()
    if(VTKm_ENABLE_KOKKOS)
        target_link_libraries(avtfilters_ser amdhip64)
    endif()
endif()
VISIT_INSTALL_TARGETS(avtfilters_ser)

#********************************* PARALLEL **********************************
IF(VISIT_PARALLEL)
    ADD_PARALLEL_LIBRARY(avtfilters_par ${AVTFILTERS_SOURCES})
    TARGET_LINK_LIBRARIES(avtfilters_par visitcommon lightweight_visit_vtk visit_vtk avtmath avtview avtpipeline_par avtdatabase_par avtdbatts ${vtklibs})
    if(HAVE_LIBVTKM)
        target_link_libraries(avtfilters_par vtkm_cont vtkm_filter_contour vtkm_filter_entity_extraction vtkm_filter_field_conversion)
        if(NOT WIN32)
            target_link_libraries(avtfilters_par Threads::Threads)
        endif()
        if(VTKm_ENABLE_KOKKOS)
            target_link_libraries(avtfilters_par amdhip64)
        endif()
    endif()
    VISIT_INSTALL_TARGETS(avtfilters_par)
ENDIF(VISIT_PARALLEL)
